
<template>
    <div class="findNewcontentBox">
        <div class="leftBox">
            <div class="lable">
                <div class="tips">为您找到以下品牌店</div>
                <!-- <el-tag v-for="tag in tagsData" :key="tag" class="mx-1" closable :disable-transitions="false"
                    @close="handleClose(tag)">
                    {{ tag }}
                </el-tag> -->
            </div>
            <div v-infinite-scroll="load" class="scroll" style="height:1000px;overflow: auto;">
                <!-- 品牌列表 -->
                <div class="itemBox" v-for="(item, index) in data" :key="index"  @click.stop="router.push({path:'/store',query:{id:item.id} })">
                    <img class="itemImage" :src="item.store_image" alt="">
                    <div class="itemContent">
                        <div class="topBox">{{ item.store_name }}</div>
                        <div class="itemInfo">{{ item.main_business.join(' | ') }}</div>
                        <div class="lableBtnBox">
                            <!-- <div class="lableBtn">物美价廉</div> -->
                            <div class="lableBtn" v-for="item1 in item.tags" :key="item1">{{ item1}}</div>
                            <!-- <div class="lableBtn">良心店</div> -->
                        </div>
                        <div class="slogan">{{ item.store_info }}</div>
                        <div class="Turnover">已成交{{ item.pay_number }}</div>
                    </div>
                    <!-- <div class="nowBtn">立即沟通</div>
                    <img class="Brandlove" src="../../../assets/Image/Brandlove.png" alt=""> -->
                </div>

            </div>

            <!-- 品牌列表 -- end -->

        </div>
        <div class="rightBox">
            <div class="imgBox">
                <img src="../../../assets/Image/pinpaiLogo.png" alt="">
            </div>

            <div class="itemBoxR" v-for="(item, index) in RankData" :key="index" @click.stop="router.push({path:'/store',query:{id:item.id} })">
                <img class="itemImg" :src="item.store_image" alt="">   

                <div class="name">{{ item.store_name }}</div>
            </div>
        </div>

    </div>
</template>
  
<script lang="ts" setup>

import { defineProps, ref, defineEmits } from "vue";
import { selectMerchantStoreRank, } from "../../../utils/api"
import { useRouter } from "vue-router";
const router = useRouter();

const props = defineProps({
    data: {
        type: Array as () => Array<any>, //(string也可以是其他你自定义的接口)
        required: true,
        default: () => []
    }
});
const emit = defineEmits(['load'])
const load = () => {
    emit('load')
}
const RankData = ref([{ store_image: '', store_name: '' }])
selectMerchantStoreRank({}).then(res => {
    console.log(res, '品牌榜单');
    RankData.value = res.data.data
})

// const tagsData = ref([

// ])


// const gotoscroll = (id: number) => {
//     let ac = document.getElementById(id + '');
//     if (ac !== null) {
//         ac.scrollIntoView({ block: "center", behavior: "smooth" });
//     }
// }


</script>
  
  
<style scoped lang="less">
.findNewcontentBox {
    max-width: 1920px;
    margin: 0 auto;
    background-size: 100% 100%;
    padding: 40px 224px 50px;
    box-sizing: border-box;
    position: relative;
    display: flex;
    justify-content: space-between;

    .leftBox {
        width: 1036px;

        .lable {
            height: 64px;
            background: #FFFFFF;
            padding: 20px 18px;
            box-sizing: border-box;
            margin-bottom: 20px;
            padding: 18px 20px;
            box-sizing: border-box;

            .tips {
                height: 28px;
                font-size: 20px;
                font-family: PingFang SC-Medium, PingFang SC;
                font-weight: 500;
                color: #333333;
                line-height: 28px;
                margin-right: 40px;
            }
        }

        .itemBox {
            height: 266px;
            background: #FFFFFF;
            border-radius: 0px 0px 0px 0px;
            opacity: 1;
            padding: 20px;
            box-sizing: border-box;
            display: flex;
            justify-content: space-between;
            position: relative;
            margin-bottom: 20px;

            .Brandlove {
                position: absolute;
                right: 20px;
                top: 20px;
                width: 40px;
                height: 40px;
                cursor: pointer;
            }

            .nowBtn {
                font-size: 20px;
                font-family: PingFang SC-Medium, PingFang SC;
                font-weight: 500;
                color: #5C7DCD;
                width: 160px;
                height: 48px;
                background: rgba(60, 105, 194, 0.2);
                border-radius: 24px 24px 24px 24px;
                line-height: 48px;
                text-align: center;
                position: absolute;
                right: 20px;
                bottom: 20px;
                cursor: pointer;
            }

            .itemImage {
                width: 226px;
                height: 226px;
                margin-right: 20px;
                display: block;
            }

            .itemContent {
                flex: 1;
                // background-color: #ccc;

                .itemInfo {
                    height: 25px;
                    font-size: 18px;
                    font-family: PingFang SC-Medium, PingFang SC;
                    font-weight: 500;
                    color: #999999;
                    line-height: 25px;
                    margin-bottom: 40px;
                }

                .topBox {
                    height: 33px;
                    font-size: 24px;
                    font-family: PingFang SC-Medium, PingFang SC;
                    font-weight: 500;
                    color: #333333;
                    margin-bottom: 10px;
                    line-height: 33px;
                }

                .lableBtnBox {
                    display: flex;
                    margin-bottom: 15px;

                    .lableBtn {
                        padding: 5px 10px;
                        box-sizing: border-box;
                        height: 32px;
                        background: #FFF2D0;
                        border-radius: 4px 4px 4px 4px;
                        font-size: 16px;
                        font-family: PingFang SC-Medium, PingFang SC;
                        font-weight: 500;
                        color: #666666;
                        line-height: 22px;
                        text-align: center;
                        margin-right: 10px;
                    }

                    .lableBtn:nth-child(2n) {
                        padding: 5px 10px;
                        box-sizing: border-box;
                        height: 32px;
                        background: #FFDED3;
                        border-radius: 4px 4px 4px 4px;
                        font-size: 16px;
                        font-family: PingFang SC-Medium, PingFang SC;
                        font-weight: 500;
                        color: #666666;
                        line-height: 22px;
                        text-align: center;
                        margin-right: 10px;
                    }
                }

                .slogan {
                    height: 25px;
                    font-size: 18px;
                    font-family: PingFang SC-Medium, PingFang SC;
                    font-weight: 500;
                    color: #999999;
                    line-height: 25px;
                    margin-bottom: 24px;
                }

                .Turnover {
                    height: 22px;
                    font-size: 16px;
                    font-family: PingFang SC-Medium, PingFang SC;
                    font-weight: 500;
                    color: #999999;
                    line-height: 22px;
                }



            }

        }

        /* 改变element表格的滚动条样式 */
        .scroll::-webkit-scrollbar {
            width: 4px;
            /* 纵向滚动条的大小 */
            height: 5px;
            display: none;
            /* 横向滚动条的大小 */
        }

        .scroll::-webkit-scrollbar-thumb {
            border-radius: 5px;
            // -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            background: rgba(0, 0, 0, 0.2);
        }

        .scroll::-webkit-scrollbar-track {
            // -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            border-radius: 0;
            background: rgba(0, 0, 0, 0.1);
        }

    }

    .rightBox {
        width: 416px;

        .imgBox {
            height: 76px;
            background-color: #fff;
            padding-top: 20px;
            box-sizing: border-box;

            img {
                width: 200px;
                height: 40px;
                margin: 0 auto;
            }
        }

        .itemBoxR {
            padding: 20px 0 0 0;
            box-sizing: border-box;
            background-color: #FFFFFF;
            padding-bottom: 40px;
            border-top: 1px solid #CCCCCC;

            .itemImg {
                width: 226px;
                height: 226px;
                background: #F2F2F2;
                margin: 0 auto;
                margin-bottom: 10px;
            }

            .name {
                height: 33px;
                font-size: 24px;
                font-family: PingFang SC-Medium, PingFang SC;
                font-weight: 500;
                color: #333333;
                line-height: 33px;
                text-align: center;
            }
        }
    }

}
</style>
  